﻿using System;
using UnityEngine;

public class ConvertUtils {
	public static ConvertUtils GetInstance() { return new ConvertUtils(); }

	public Vector3 StringToVector3(string value) {
		var numbers = value.Split(new string[] { "(", ", ", ")" }, StringSplitOptions.RemoveEmptyEntries);
		if (numbers.Length != 3) {
			throw new ArgumentException(value + " is not a Vector3");
		}
		return new Vector3(Convert.ToSingle(numbers[0]), Convert.ToSingle(numbers[1]), Convert.ToSingle(numbers[2]));
	}
}
